package com.boarsoft.boar.batch.service;

import com.boarsoft.bean.ReplyInfo;
import com.boarsoft.boar.batch.biz.BatchExecutionBiz;
import com.boarsoft.boar.batch.entity.BatchExecution;
import org.springframework.beans.factory.annotation.Autowired;

public class BatchStsCheckServiceImpl implements BatchStsCheckService {

    @Autowired
    private BatchExecutionBiz batchExecutionBiz;

    @Override
    public ReplyInfo<Object> check(String batchId) {
        //查询当前id对应的batch_execution记录状态
        BatchExecution be = batchExecutionBiz.getBybatchId(batchId);
        if (be == null) {
            return ReplyInfo.error("沒有查询到对应的登记记录.", batchId);
        }
        return ReplyInfo.success(be.getStatus());
    }
}
